//package com.aracky.flowable.controller;
//
//import com.aracky.common.vo.CommonResult;
//import com.aracky.common.vo.PageVO;
//import com.aracky.flowable.model.request.StartFlowableRequest;
//import com.aracky.flowable.service.ProcessService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.flowable.engine.history.HistoricProcessInstance;
//import org.flowable.engine.runtime.Execution;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.ResponseEntity;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * @Author zengzhiping
// * @BelongsPackage com.aracky.flowable.controller
// * @CreateTime 2022-08-17
// * @Description
// */
//@Api(tags = "流程相关接口", hidden = true)
//@RestController
//@RequestMapping("/process")
//public class ProcessController {
//
//    @Autowired
//    private ProcessService processService;
//
//    @GetMapping("getChart")
//    @ApiOperation("流程图")
//    public ResponseEntity<byte[]> getFlowChart(String processId) {
//        return processService.genProcessDiagram(processId);
//    }
//
//
//    @ApiOperation("查询所有启动的流程列表")
//    @PostMapping("executions")
//    public CommonResult<PageVO<Execution>> executions(@RequestBody StartFlowableRequest flowableRequest) {
//        return CommonResult.success(processService.executions(flowableRequest));
//    }
//
//
//    @ApiOperation("终止流程")
//    @GetMapping("stop-process-instance-by-id")
//    public CommonResult<String> deleteProcessInstanceById(String processInstanceId, String reason) {
//        String instance = processService.deleteProcessInstanceById(processInstanceId, reason);
//        return CommonResult.success(instance, "流程终止成功");
//    }
//
//    @ApiOperation("挂起流程实例")
//    @GetMapping("hand-up-process-instance")
//    public CommonResult<String> handUpProcessInstance(String processInstanceId) {
//        String instance = processService.handUpProcessInstance(processInstanceId);
//        return CommonResult.success(instance, "流程挂起成功");
//    }
//
//    @ApiOperation("（唤醒）被挂起的流程实例")
//    @GetMapping("activate-process-instance")
//    public CommonResult<String> activateProcessInstance(String processInstanceId) {
//        String instance = processService.activateProcessInstance(processInstanceId);
//        return CommonResult.success(instance, "流程唤醒成功");
//    }
//
//    @ApiOperation("判断传入流程实例在运行中是否存在")
//    @GetMapping("is-exist-proc-int-running")
//    public CommonResult<Boolean> isExistProcIntRunning(String processInstanceId) {
//        Boolean existProcIntRunning = processService.isExistProcIntRunning(processInstanceId);
//        return CommonResult.success(existProcIntRunning);
//    }
//
//    @ApiOperation("我发起的流程实例列表")
//    @GetMapping("get-my-start-procint")
//    public CommonResult<List<HistoricProcessInstance>> getMyStartProcint(String userId) {
//        List<HistoricProcessInstance> myStartProcint = processService.getMyStartProcint(userId);
//        return CommonResult.success(myStartProcint);
//    }
//
//}
